﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ConsolidationTool.Common.Entities;
using System.Collections.Generic;
using ConsolidationTool.Common;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using ConsolidationTool.WebParts.ControlTemplates;

using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;

namespace ConsolidationTool.WebParts.Layouts.CReport.Brochure
{
    public partial class P16FC : LayoutsPageBase
    {
        List<Group> regionGroup = new List<Group>();
        List<Group> subRegionGroup = new List<Group>();
        List<Group> entityGroup = new List<Group>();
        public CommonEntitySelector TopSelector { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            TopSelector = (commonEntitySelector as CommonEntitySelector);
            //TopSelector.EntitySelectorChanged += new CommonEntitySelector.EntitySelectorChangeHandler(TopSelector_EntitySelectorChanged);

            if (!IsPostBack)
            {
                InitBaseInfo();
            }
        }

        void InitBaseInfo()
        {
            // lbCompanyName.Text = Constants.Company_Name;
            TopSelector.yearTextBox.Text = Common.BusinessService.GetConfiguration(Constants.Flash_Input_Year);
            TopSelector.monthTextBox.Text = Common.BusinessService.GetConfiguration(Constants.Flash_Input_Month);


            switch (TopSelector.monthTextBox.Text)
            {
                case "1":
                    LabelCurrentMonth.Text = "January " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD January " + TopSelector.yearTextBox.Text;
                    break;
                case "2":
                    LabelCurrentMonth.Text = "February " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD February " + TopSelector.yearTextBox.Text;
                    break;
                case "3":
                    LabelCurrentMonth.Text = "March " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD March " + TopSelector.yearTextBox.Text;
                    break;
                case "4":
                    LabelCurrentMonth.Text = "April " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD April " + TopSelector.yearTextBox.Text;
                    break;
                case "5":
                    LabelCurrentMonth.Text = "May " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD May " + TopSelector.yearTextBox.Text;
                    break;
                case "6":
                    LabelCurrentMonth.Text = "June " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD June " + TopSelector.yearTextBox.Text;
                    break;
                case "7":
                    LabelCurrentMonth.Text = "July " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD July " + TopSelector.yearTextBox.Text;
                    break;
                case "8":
                    LabelCurrentMonth.Text = "August " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD August " + TopSelector.yearTextBox.Text;
                    break;
                case "9":
                    LabelCurrentMonth.Text = "September " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD September " + TopSelector.yearTextBox.Text;
                    break;
                case "10":
                    LabelCurrentMonth.Text = "October " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD October " + TopSelector.yearTextBox.Text;
                    break;
                case "11":
                    LabelCurrentMonth.Text = "November " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD November " + TopSelector.yearTextBox.Text;
                    break;
                case "12":
                    LabelCurrentMonth.Text = "December " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD December " + TopSelector.yearTextBox.Text;
                    break;
                default:
                    break;
            }
        }

        protected void GenerateReport_Click(object sender, EventArgs e)
        {
            switch (TopSelector.monthTextBox.Text)
            {
                case "1":
                    LabelCurrentMonth.Text = "January " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD January " + TopSelector.yearTextBox.Text;
                    break;
                case "2":
                    LabelCurrentMonth.Text = "February " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD February " + TopSelector.yearTextBox.Text;
                    break;
                case "3":
                    LabelCurrentMonth.Text = "March " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD March " + TopSelector.yearTextBox.Text;
                    break;
                case "4":
                    LabelCurrentMonth.Text = "April " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD April " + TopSelector.yearTextBox.Text;
                    break;
                case "5":
                    LabelCurrentMonth.Text = "May " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD May " + TopSelector.yearTextBox.Text;
                    break;
                case "6":
                    LabelCurrentMonth.Text = "June " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD June " + TopSelector.yearTextBox.Text;
                    break;
                case "7":
                    LabelCurrentMonth.Text = "July " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD July " + TopSelector.yearTextBox.Text;
                    break;
                case "8":
                    LabelCurrentMonth.Text = "August " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD August " + TopSelector.yearTextBox.Text;
                    break;
                case "9":
                    LabelCurrentMonth.Text = "September " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD September " + TopSelector.yearTextBox.Text;
                    break;
                case "10":
                    LabelCurrentMonth.Text = "October " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD October " + TopSelector.yearTextBox.Text;
                    break;
                case "11":
                    LabelCurrentMonth.Text = "November " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD November " + TopSelector.yearTextBox.Text;
                    break;
                case "12":
                    LabelCurrentMonth.Text = "December " + TopSelector.yearTextBox.Text;
                    LabelYTD.Text = "YTD December " + TopSelector.yearTextBox.Text;
                    break;
                default:
                    break;
            }

            //邦定current月数据
            BindLastMonth(TopSelector.lbCoCd.Text, TopSelector.yearTextBox.Text, TopSelector.monthTextBox.Text);

            AbsFix(1, 8);
            AbsFix(11, 18);
        }
        private void AbsFix(int start, int end)
        {
            var allLabel = Page.Controls.AllOfType<Label>();
            for (int i = start; i <= end; i++)
            {
                string fixi = i < 10 ? "0" + i : i + "";

                for (int a = 1; a <= 10; a++)
                {
                    var lab = allLabel.FirstOrDefault(p => p.ID == string.Format("Label{0}_Day{1}", fixi, a)) as Label;
                    string text = lab.Text;
                    if (text != "0")
                        text = text.StartsWith("-") ? text.Substring(1) : "-" + text;
                    lab.Text = text;
                }
            }
        }

        protected void ExportReport_Click(object sender, EventArgs e)
        {
            P6PL col01 = null;
            col01 = new P6PL();
            col01.row01 = Label01_Day1.Text;
            col01.row02 = Label02_Day1.Text;
            col01.row03 = Label03_Day1.Text;
            col01.row04 = Label04_Day1.Text;
            col01.row05 = Label05_Day1.Text;
            col01.row06 = Label06_Day1.Text;
            col01.row07 = Label07_Day1.Text;
            col01.row08 = Label08_Day1.Text;
            col01.row09 = Label09_Day1.Text;
            col01.row10 = Label10_Day1.Text;
            col01.row11 = Label11_Day1.Text;
            col01.row12 = Label12_Day1.Text;
            col01.row13 = Label13_Day1.Text;
            col01.row14 = Label14_Day1.Text;
            col01.row15 = Label15_Day1.Text;
            col01.row16 = Label16_Day1.Text;
            col01.row17 = Label17_Day1.Text;
            col01.row18 = Label18_Day1.Text;
            col01.row19 = Label19_Day1.Text;
            col01.row20 = Label20_Day1.Text;

            P6PL col02 = null;
            col02 = new P6PL();
            col02.row01 = Label01_Day2.Text;
            col02.row02 = Label02_Day2.Text;
            col02.row03 = Label03_Day2.Text;
            col02.row04 = Label04_Day2.Text;
            col02.row05 = Label05_Day2.Text;
            col02.row06 = Label06_Day2.Text;
            col02.row07 = Label07_Day2.Text;
            col02.row08 = Label08_Day2.Text;
            col02.row09 = Label09_Day2.Text;
            col02.row10 = Label10_Day2.Text;
            col02.row11 = Label11_Day2.Text;
            col02.row12 = Label12_Day2.Text;
            col02.row13 = Label13_Day2.Text;
            col02.row14 = Label14_Day2.Text;
            col02.row15 = Label15_Day2.Text;
            col02.row16 = Label16_Day2.Text;
            col02.row17 = Label17_Day2.Text;
            col02.row18 = Label18_Day2.Text;
            col02.row19 = Label19_Day2.Text;
            col02.row20 = Label20_Day2.Text;

            P6PL col03 = null;
            col03 = new P6PL();
            col03.row01 = Label01_Day3.Text;
            col03.row02 = Label02_Day3.Text;
            col03.row03 = Label03_Day3.Text;
            col03.row04 = Label04_Day3.Text;
            col03.row05 = Label05_Day3.Text;
            col03.row06 = Label06_Day3.Text;
            col03.row07 = Label07_Day3.Text;
            col03.row08 = Label08_Day3.Text;
            col03.row09 = Label09_Day3.Text;
            col03.row10 = Label10_Day3.Text;
            col03.row11 = Label11_Day3.Text;
            col03.row12 = Label12_Day3.Text;
            col03.row13 = Label13_Day3.Text;
            col03.row14 = Label14_Day3.Text;
            col03.row15 = Label15_Day3.Text;
            col03.row16 = Label16_Day3.Text;
            col03.row17 = Label17_Day3.Text;
            col03.row18 = Label18_Day3.Text;
            col03.row19 = Label19_Day3.Text;
            col03.row20 = Label20_Day3.Text;

            P6PL col04 = null;
            col04 = new P6PL();
            col04.row01 = Label01_Day4.Text;
            col04.row02 = Label02_Day4.Text;
            col04.row03 = Label03_Day4.Text;
            col04.row04 = Label04_Day4.Text;
            col04.row05 = Label05_Day4.Text;
            col04.row06 = Label06_Day4.Text;
            col04.row07 = Label07_Day4.Text;
            col04.row08 = Label08_Day4.Text;
            col04.row09 = Label09_Day4.Text;
            col04.row10 = Label10_Day4.Text;
            col04.row11 = Label11_Day4.Text;
            col04.row12 = Label12_Day4.Text;
            col04.row13 = Label13_Day4.Text;
            col04.row14 = Label14_Day4.Text;
            col04.row15 = Label15_Day4.Text;
            col04.row16 = Label16_Day4.Text;
            col04.row17 = Label17_Day4.Text;
            col04.row18 = Label18_Day4.Text;
            col04.row19 = Label19_Day4.Text;
            col04.row20 = Label20_Day4.Text;

            P6PL col05 = null;
            col05 = new P6PL();
            col05.row01 = Label01_Day5.Text;
            col05.row02 = Label02_Day5.Text;
            col05.row03 = Label03_Day5.Text;
            col05.row04 = Label04_Day5.Text;
            col05.row05 = Label05_Day5.Text;
            col05.row06 = Label06_Day5.Text;
            col05.row07 = Label07_Day5.Text;
            col05.row08 = Label08_Day5.Text;
            col05.row09 = Label09_Day5.Text;
            col05.row10 = Label10_Day5.Text;
            col05.row11 = Label11_Day5.Text;
            col05.row12 = Label12_Day5.Text;
            col05.row13 = Label13_Day5.Text;
            col05.row14 = Label14_Day5.Text;
            col05.row15 = Label15_Day5.Text;
            col05.row16 = Label16_Day5.Text;
            col05.row17 = Label17_Day5.Text;
            col05.row18 = Label18_Day5.Text;
            col05.row19 = Label19_Day5.Text;
            col05.row20 = Label20_Day5.Text;

            P6PL col06 = null;
            col06 = new P6PL();
            col06.row01 = Label01_Day6.Text;
            col06.row02 = Label02_Day6.Text;
            col06.row03 = Label03_Day6.Text;
            col06.row04 = Label04_Day6.Text;
            col06.row05 = Label05_Day6.Text;
            col06.row06 = Label06_Day6.Text;
            col06.row07 = Label07_Day6.Text;
            col06.row08 = Label08_Day6.Text;
            col06.row09 = Label09_Day6.Text;
            col06.row10 = Label10_Day6.Text;
            col06.row11 = Label11_Day6.Text;
            col06.row12 = Label12_Day6.Text;
            col06.row13 = Label13_Day6.Text;
            col06.row14 = Label14_Day6.Text;
            col06.row15 = Label15_Day6.Text;
            col06.row16 = Label16_Day6.Text;
            col06.row17 = Label17_Day6.Text;
            col06.row18 = Label18_Day6.Text;
            col06.row19 = Label19_Day6.Text;
            col06.row20 = Label20_Day6.Text;

            P6PL col07 = null;
            col07 = new P6PL();
            col07.row01 = Label01_Day7.Text;
            col07.row02 = Label02_Day7.Text;
            col07.row03 = Label03_Day7.Text;
            col07.row04 = Label04_Day7.Text;
            col07.row05 = Label05_Day7.Text;
            col07.row06 = Label06_Day7.Text;
            col07.row07 = Label07_Day7.Text;
            col07.row08 = Label08_Day7.Text;
            col07.row09 = Label09_Day7.Text;
            col07.row10 = Label10_Day7.Text;
            col07.row11 = Label11_Day7.Text;
            col07.row12 = Label12_Day7.Text;
            col07.row13 = Label13_Day7.Text;
            col07.row14 = Label14_Day7.Text;
            col07.row15 = Label15_Day7.Text;
            col07.row16 = Label16_Day7.Text;
            col07.row17 = Label17_Day7.Text;
            col07.row18 = Label18_Day7.Text;
            col07.row19 = Label19_Day7.Text;
            col07.row20 = Label20_Day7.Text;

            P6PL col08 = null;
            col08 = new P6PL();
            col08.row01 = Label01_Day8.Text;
            col08.row02 = Label02_Day8.Text;
            col08.row03 = Label03_Day8.Text;
            col08.row04 = Label04_Day8.Text;
            col08.row05 = Label05_Day8.Text;
            col08.row06 = Label06_Day8.Text;
            col08.row07 = Label07_Day8.Text;
            col08.row08 = Label08_Day8.Text;
            col08.row09 = Label09_Day8.Text;
            col08.row10 = Label10_Day8.Text;
            col08.row11 = Label11_Day8.Text;
            col08.row12 = Label12_Day8.Text;
            col08.row13 = Label13_Day8.Text;
            col08.row14 = Label14_Day8.Text;
            col08.row15 = Label15_Day8.Text;
            col08.row16 = Label16_Day8.Text;
            col08.row17 = Label17_Day8.Text;
            col08.row18 = Label18_Day8.Text;
            col08.row19 = Label19_Day8.Text;
            col08.row20 = Label20_Day8.Text;

            P6PL col09 = null;
            col09 = new P6PL();
            col09.row01 = Label01_Day9.Text;
            col09.row02 = Label02_Day9.Text;
            col09.row03 = Label03_Day9.Text;
            col09.row04 = Label04_Day9.Text;
            col09.row05 = Label05_Day9.Text;
            col09.row06 = Label06_Day9.Text;
            col09.row07 = Label07_Day9.Text;
            col09.row08 = Label08_Day9.Text;
            col09.row09 = Label09_Day9.Text;
            col09.row10 = Label10_Day9.Text;
            col09.row11 = Label11_Day9.Text;
            col09.row12 = Label12_Day9.Text;
            col09.row13 = Label13_Day9.Text;
            col09.row14 = Label14_Day9.Text;
            col09.row15 = Label15_Day9.Text;
            col09.row16 = Label16_Day9.Text;
            col09.row17 = Label17_Day9.Text;
            col09.row18 = Label18_Day9.Text;
            col09.row19 = Label19_Day9.Text;
            col09.row20 = Label20_Day9.Text;

            P6PL col10 = null;
            col10 = new P6PL();
            col10.row01 = Label01_Day10.Text;
            col10.row02 = Label02_Day10.Text;
            col10.row03 = Label03_Day10.Text;
            col10.row04 = Label04_Day10.Text;
            col10.row05 = Label05_Day10.Text;
            col10.row06 = Label06_Day10.Text;
            col10.row07 = Label07_Day10.Text;
            col10.row08 = Label08_Day10.Text;
            col10.row09 = Label09_Day10.Text;
            col10.row10 = Label10_Day10.Text;
            col10.row11 = Label11_Day10.Text;
            col10.row12 = Label12_Day10.Text;
            col10.row13 = Label13_Day10.Text;
            col10.row14 = Label14_Day10.Text;
            col10.row15 = Label15_Day10.Text;
            col10.row16 = Label16_Day10.Text;
            col10.row17 = Label17_Day10.Text;
            col10.row18 = Label18_Day10.Text;
            col10.row19 = Label19_Day10.Text;
            col10.row20 = Label20_Day10.Text;

            string fileName = TopSelector.yearTextBox.Text + TopSelector.monthTextBox.Text + Constants._Brochure_P16_PRIFIX + TopSelector.lbCoCd.Text + ".xlsx";
            BusinessService.CreateP16Excel(LabelTitile00.Text, col01, col02, col03, col04, col05, col06, col07, col08, col09, col10, fileName, LabelCurrentMonth.Text, LabelYTD.Text);
            SPSite site = new SPSite(SPContext.Current.Site.ID);
            string reportUrl = site.Url + "/" + Constants._EXCEL_Library + "/" + fileName;
            Page.ClientScript.RegisterStartupScript(this.GetType(), "Message", string.Format("<script>window.open('" + reportUrl + "');</script>"));

        }

        [Serializable]
        public class fsentity
        {
            public bool controlrow { get; set; }
            public bool datarow { get; set; }
            public bool insertcontrol { get; set; }
            public bool bold { get; set; }
            public string unit { get; set; }
            public string accountcode { get; set; }
            public string description { get; set; }
            public string Jan { get; set; }
            public string Feb { get; set; }
            public string Mar { get; set; }
            public string Apr { get; set; }
            public string May { get; set; }
            public string Jun { get; set; }
            public string Jul { get; set; }
            public string Aug { get; set; }
            public string Sep { get; set; }
            public string Oct { get; set; }
            public string Nov { get; set; }
            public string Dec { get; set; }
            public int digits { get; set; }
        }

        void BindLastMonth(string coCd, string year, string month)
        {
            string strCurrency = TopSelector.lbCompanyCurrency.Text;
            string strTonnage = TopSelector.lbCompanyTonnage.Text;

            LabelTitile00.Text = strCurrency;

            int y = Convert.ToInt32(year)-1;
            string yearN_1 = Convert.ToString(y);
            SPListItem itemFC = Common.BusinessService.GetItem(coCd, year, month, "Gross Fixed Cost");
            SPListItem itemPL = Common.BusinessService.GetItem(coCd, year, month, "P_L");
            SPListItem itemHR = Common.BusinessService.GetItem(coCd, year, month, "HR");
            SPListItem itemFCN_1 = Common.BusinessService.GetItem(coCd, yearN_1, month, "Gross Fixed Cost");
            SPListItem itemPLN_1 = Common.BusinessService.GetItem(coCd, yearN_1, month, "P_L");
            SPListItem itemHRN_1 = Common.BusinessService.GetItem(coCd, yearN_1, month, "HR");
            

            Label01_Day1.Text = "0";
            Label02_Day1.Text = "0";
            Label03_Day1.Text = "0";
            Label04_Day1.Text = "0";
            Label05_Day1.Text = "0";
            Label06_Day1.Text = "0";
            Label07_Day1.Text = "0";
            Label08_Day1.Text = "0";
            Label09_Day1.Text = "0";
            Label10_Day1.Text = "0";
            Label11_Day1.Text = "0";
            Label12_Day1.Text = "0";
            Label13_Day1.Text = "0";
            Label14_Day1.Text = "0";
            Label15_Day1.Text = "0";
            Label16_Day1.Text = "0";
            Label17_Day1.Text = "0";
            Label18_Day1.Text = "0";
            Label19_Day1.Text = "0";
            Label20_Day1.Text = "0";

            if (itemFCN_1 != null)
            {
                Label01_Day1.Text = itemFCN_1["CM_FC02010103"].ToString();
                Label02_Day1.Text = itemFCN_1["CM_FC02010203"].ToString();
                Label03_Day1.Text = itemFCN_1["CM_FC02010303"].ToString();
                Label05_Day1.Text = itemFCN_1["CM_FC02010403"].ToString();
                Label06_Day1.Text = itemFCN_1["CM_FC02010503"].ToString();
                Label07_Day1.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["CM_FC02010103"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010203"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010303"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010403"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010503"].ToString()));
                Label11_Day1.Text = itemFCN_1["CM_FC02010102"].ToString();
                Label12_Day1.Text = itemFCN_1["CM_FC02010202"].ToString();
                Label13_Day1.Text = itemFCN_1["CM_FC02010302"].ToString();
                Label15_Day1.Text = itemFCN_1["CM_FC02010402"].ToString();
                Label16_Day1.Text = itemFCN_1["CM_FC02010502"].ToString();
                Label17_Day1.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["CM_FC02010102"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010202"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010302"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010402"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010502"].ToString()));

            }
            if (itemHRN_1 != null)
            {
                Label09_Day1.Text = itemHRN_1["HR01020103"].ToString();
                Label19_Day1.Text = itemHRN_1["HR01020102"].ToString();
            }
            if (itemPLN_1 != null)
            {
                if (itemPLN_1["CM_PL02010101-1"].ToString() != "0" && itemPLN_1["CM_PL02010101-1"].ToString() != "0.00")
                {
                    Label08_Day1.Text = (Convert.ToDecimal(Label07_Day1.Text) / Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString())*1000).ToString("n");
                    Label18_Day1.Text = (Convert.ToDecimal(Label17_Day1.Text) / Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString()) * 1000).ToString("n");
                }
                
                if (Label09_Day1.Text == "0" || Label09_Day1.Text == "0.00")
                {
                    Label10_Day1.Text = "0";
                }
                else
                {
                    Label10_Day1.Text = (Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString()) / Convert.ToDecimal(Label09_Day1.Text)).ToString("n");
                }
                if (Label19_Day1.Text == "0" || Label19_Day1.Text == "0.00")
                {
                    Label20_Day1.Text = "0"; 
                }
                else
                {
                    Label20_Day1.Text = (Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString()) / Convert.ToDecimal(Label19_Day1.Text)).ToString("n");
                }
            }

            Label01_Day3.Text = "0";
            Label02_Day3.Text = "0";
            Label03_Day3.Text = "0";
            Label04_Day3.Text = "0";
            Label05_Day3.Text = "0";
            Label06_Day3.Text = "0";
            Label07_Day3.Text = "0";
            Label08_Day3.Text = "0";
            Label09_Day3.Text = "0";
            Label10_Day3.Text = "0";
            Label11_Day3.Text = "0";
            Label12_Day3.Text = "0";
            Label13_Day3.Text = "0";
            Label14_Day3.Text = "0";
            Label15_Day3.Text = "0";
            Label16_Day3.Text = "0";
            Label17_Day3.Text = "0";
            Label18_Day3.Text = "0";
            Label19_Day3.Text = "0";
            Label20_Day3.Text = "0";

            if (itemFC != null)
            {
                Label01_Day3.Text = itemFC["CM_FC02010103"].ToString();
                Label02_Day3.Text = itemFC["CM_FC02010203"].ToString();
                Label03_Day3.Text = itemFC["CM_FC02010303"].ToString();
                Label05_Day3.Text = itemFC["CM_FC02010403"].ToString();
                Label06_Day3.Text = itemFC["CM_FC02010503"].ToString();
                Label07_Day3.Text = Convert.ToString(Convert.ToDecimal(itemFC["CM_FC02010103"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010203"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010303"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010403"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010503"].ToString()));
                Label11_Day3.Text = itemFC["CM_FC02010102"].ToString();
                Label12_Day3.Text = itemFC["CM_FC02010202"].ToString();
                Label13_Day3.Text = itemFC["CM_FC02010302"].ToString();
                Label15_Day3.Text = itemFC["CM_FC02010402"].ToString();
                Label16_Day3.Text = itemFC["CM_FC02010502"].ToString();
                Label17_Day3.Text = Convert.ToString(Convert.ToDecimal(itemFC["CM_FC02010102"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010202"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010302"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010402"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010502"].ToString()));

            }
            if (itemHR != null)
            {
                Label09_Day3.Text = itemHR["HR01020103"].ToString();
                Label19_Day3.Text = itemHR["HR01020102"].ToString();
            }
            if (itemPL != null)
            {
                if (itemPL["CM_PL02010101-1"].ToString() != "0" && itemPL["CM_PL02010101-1"].ToString() != "0.00")
                {
                    Label08_Day3.Text = (Convert.ToDecimal(Label07_Day3.Text) / Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString())*1000).ToString("n");
                    Label18_Day3.Text = (Convert.ToDecimal(Label17_Day3.Text) / Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString()) * 1000).ToString("n");
                }
                

                if (Label09_Day3.Text == "0" || Label09_Day3.Text == "0.00")
                {
                    Label10_Day3.Text = "0";
                }
                else
                {
                    Label10_Day3.Text = (Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString()) / Convert.ToDecimal(Label09_Day3.Text)).ToString("n");
                }
                if (Label19_Day3.Text == "0" || Label19_Day3.Text == "0.00")
                {
                    Label20_Day3.Text = "0";
                }
                else
                {
                    Label20_Day3.Text = (Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString()) / Convert.ToDecimal(Label19_Day3.Text)).ToString("n");
                }
            }

            Label01_Day6.Text = "0";
            Label02_Day6.Text = "0";
            Label03_Day6.Text = "0";
            Label04_Day6.Text = "0";
            Label05_Day6.Text = "0";
            Label06_Day6.Text = "0";
            Label07_Day6.Text = "0";
            Label08_Day6.Text = "0";
            Label09_Day6.Text = "0";
            Label10_Day6.Text = "0";
            Label11_Day6.Text = "0";
            Label12_Day6.Text = "0";
            Label13_Day6.Text = "0";
            Label14_Day6.Text = "0";
            Label15_Day6.Text = "0";
            Label16_Day6.Text = "0";
            Label17_Day6.Text = "0";
            Label18_Day6.Text = "0";
            Label19_Day6.Text = "0";
            Label20_Day6.Text = "0";

            if (itemFCN_1 != null)
            {
                Label01_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010103"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010103"].ToString()));
                Label02_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010203"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010203"].ToString()));
                Label03_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010303"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010303"].ToString()));
                Label05_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010403"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010403"].ToString()));
                Label06_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010503"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010503"].ToString())); 
                Label07_Day6.Text = Convert.ToString(Convert.ToDecimal(Label01_Day6.Text) + Convert.ToDecimal(Label02_Day6.Text) + Convert.ToDecimal(Label03_Day6.Text) + Convert.ToDecimal(Label05_Day6.Text) + Convert.ToDecimal(Label06_Day6.Text));
                Label11_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010102"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010102"].ToString()));
                Label12_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010202"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010202"].ToString()));
                Label13_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010302"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010302"].ToString()));
                Label15_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010402"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010402"].ToString()));
                Label16_Day6.Text = Convert.ToString(Convert.ToDecimal(itemFCN_1["YTDM1_FC02010502"].ToString()) + Convert.ToDecimal(itemFCN_1["CM_FC02010502"].ToString())); 
                Label17_Day6.Text = Convert.ToString(Convert.ToDecimal(Label11_Day6.Text) + Convert.ToDecimal(Label12_Day6.Text) + Convert.ToDecimal(Label13_Day6.Text) + Convert.ToDecimal(Label15_Day6.Text) + Convert.ToDecimal(Label16_Day6.Text));
            }

            int m = Convert.ToInt32(TopSelector.monthTextBox.Text);

            for (int i = 1; i <= m; i++)
            {
                string strMonth = i.ToString();

                SPListItem itemHRN_1YTD = Common.BusinessService.GetItem(coCd, yearN_1, strMonth, "HR");
                if (itemHRN_1YTD != null)
                {
                    Label09_Day6.Text = Convert.ToString(Convert.ToDecimal(Label09_Day6.Text) + Convert.ToDecimal(itemHRN_1YTD["HR01020103"].ToString()));
                    Label19_Day6.Text = Convert.ToString(Convert.ToDecimal(Label19_Day6.Text) + Convert.ToDecimal(itemHRN_1YTD["HR01020102"].ToString())); 
                }
            }
            Label09_Day6.Text = (Convert.ToDecimal(Label09_Day6.Text) / m).ToString("n");
            Label19_Day6.Text = (Convert.ToDecimal(Label19_Day6.Text) / m).ToString("n");
            

            if (itemPLN_1 != null)
            {
                if (Convert.ToString(Convert.ToDecimal(itemPLN_1["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString())) != "0" && Convert.ToString(Convert.ToDecimal(itemPLN_1["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString())) != "0.00")
                {
                    Label08_Day6.Text = (Convert.ToDecimal(Label07_Day6.Text) / (Convert.ToDecimal(itemPLN_1["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString()))*1000).ToString("n");
                    Label18_Day6.Text = (Convert.ToDecimal(Label17_Day6.Text) / (Convert.ToDecimal(itemPLN_1["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString())) * 1000).ToString("n");
                }

                if (Label09_Day6.Text == "0" || Label09_Day6.Text == "0.00")
                {
                    Label10_Day6.Text = "0";
                }
                else
                {
                    Label10_Day6.Text = ((Convert.ToDecimal(itemPLN_1["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString())) / Convert.ToDecimal(Label09_Day6.Text)).ToString("n");
                }
                if (Label19_Day6.Text == "0" || Label19_Day6.Text == "0.00")
                {
                    Label20_Day6.Text = "0";
                }
                else
                {
                    Label20_Day6.Text = ((Convert.ToDecimal(itemPLN_1["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPLN_1["CM_PL02010101-1"].ToString())) / Convert.ToDecimal(Label19_Day6.Text)).ToString("n");
                }
            }

            Label01_Day8.Text = "0";
            Label02_Day8.Text = "0";
            Label03_Day8.Text = "0";
            Label04_Day8.Text = "0";
            Label05_Day8.Text = "0";
            Label06_Day8.Text = "0";
            Label07_Day8.Text = "0";
            Label08_Day8.Text = "0";
            Label09_Day8.Text = "0";
            Label10_Day8.Text = "0";
            Label11_Day8.Text = "0";
            Label12_Day8.Text = "0";
            Label13_Day8.Text = "0";
            Label14_Day8.Text = "0";
            Label15_Day8.Text = "0";
            Label16_Day8.Text = "0";
            Label17_Day8.Text = "0";
            Label18_Day8.Text = "0";
            Label19_Day8.Text = "0";
            Label20_Day8.Text = "0";

            if (itemFC != null)
            {
                Label01_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010103"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010103"].ToString()));
                Label02_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010203"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010203"].ToString()));
                Label03_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010303"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010303"].ToString()));
                Label05_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010403"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010403"].ToString()));
                Label06_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010503"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010503"].ToString()));
                Label07_Day8.Text = Convert.ToString(Convert.ToDecimal(Label01_Day8.Text) + Convert.ToDecimal(Label02_Day8.Text) + Convert.ToDecimal(Label03_Day8.Text) + Convert.ToDecimal(Label05_Day8.Text) + Convert.ToDecimal(Label06_Day8.Text));
                Label11_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010102"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010102"].ToString()));
                Label12_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010202"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010202"].ToString()));
                Label13_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010302"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010302"].ToString()));
                Label15_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010402"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010402"].ToString()));
                Label16_Day8.Text = Convert.ToString(Convert.ToDecimal(itemFC["YTDM1_FC02010502"].ToString()) + Convert.ToDecimal(itemFC["CM_FC02010502"].ToString()));
                Label17_Day8.Text = Convert.ToString(Convert.ToDecimal(Label11_Day8.Text) + Convert.ToDecimal(Label12_Day8.Text) + Convert.ToDecimal(Label13_Day8.Text) + Convert.ToDecimal(Label15_Day8.Text) + Convert.ToDecimal(Label16_Day8.Text));
            }

            for (int i = 1; i <= m; i++)
            {
                string strMonth = i.ToString();

                SPListItem itemHRYTD = Common.BusinessService.GetItem(coCd, year, strMonth, "HR");
                if (itemHRYTD != null)
                {
                    Label09_Day8.Text = Convert.ToString(Convert.ToDecimal(Label09_Day8.Text) + Convert.ToDecimal(itemHRYTD["HR01020103"].ToString()));
                    Label19_Day8.Text = Convert.ToString(Convert.ToDecimal(Label19_Day8.Text) + Convert.ToDecimal(itemHRYTD["HR01020102"].ToString()));
                }
            }
            Label09_Day8.Text = (Convert.ToDecimal(Label09_Day8.Text) / m).ToString("n");
            Label19_Day8.Text = (Convert.ToDecimal(Label19_Day8.Text) / m).ToString("n");

            if (itemPL != null)
            {
                if (Convert.ToString(Convert.ToDecimal(itemPL["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString())) != "0" && Convert.ToString(Convert.ToDecimal(itemPL["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString())) != "0.00")
                {
                    Label08_Day8.Text = (Convert.ToDecimal(Label07_Day8.Text) / (Convert.ToDecimal(itemPL["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString()))*1000).ToString("n");
                    Label18_Day8.Text = (Convert.ToDecimal(Label17_Day8.Text) / (Convert.ToDecimal(itemPL["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString())) * 1000).ToString("n");
                }

                if (Label09_Day8.Text == "0" || Label09_Day8.Text == "0.00")
                {
                    Label10_Day8.Text = "0";
                }
                else
                {
                    Label10_Day8.Text = ((Convert.ToDecimal(itemPL["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString())) / Convert.ToDecimal(Label09_Day8.Text)).ToString("n");
                }
                if (Label19_Day8.Text == "0" || Label19_Day8.Text == "0.00")
                {
                    Label20_Day8.Text = "0";
                }
                else
                {
                    Label20_Day8.Text = ((Convert.ToDecimal(itemPL["YTDM1_PL02010101-1"].ToString()) + Convert.ToDecimal(itemPL["CM_PL02010101-1"].ToString())) / Convert.ToDecimal(Label19_Day8.Text)).ToString("n");
                }
            }
            
            Label01_Day2.Text = "0";
            Label02_Day2.Text = "0";
            Label03_Day2.Text = "0";
            Label04_Day2.Text = "0";
            Label05_Day2.Text = "0";
            Label06_Day2.Text = "0";
            Label07_Day2.Text = "0";
            Label08_Day2.Text = "0";
            Label09_Day2.Text = "0";
            Label10_Day2.Text = "0";
            Label11_Day2.Text = "0";
            Label12_Day2.Text = "0";
            Label13_Day2.Text = "0";
            Label14_Day2.Text = "0";
            Label15_Day2.Text = "0";
            Label16_Day2.Text = "0";
            Label17_Day2.Text = "0";
            Label18_Day2.Text = "0";
            Label19_Day2.Text = "0";
            Label20_Day2.Text = "0";

            Label01_Day7.Text = "0";
            Label02_Day7.Text = "0";
            Label03_Day7.Text = "0";
            Label04_Day7.Text = "0";
            Label05_Day7.Text = "0";
            Label06_Day7.Text = "0";
            Label07_Day7.Text = "0";
            Label08_Day7.Text = "0";
            Label09_Day7.Text = "0";
            Label10_Day7.Text = "0";
            Label11_Day7.Text = "0";
            Label12_Day7.Text = "0";
            Label13_Day7.Text = "0";
            Label14_Day7.Text = "0";
            Label15_Day7.Text = "0";
            Label16_Day7.Text = "0";
            Label17_Day7.Text = "0";
            Label18_Day7.Text = "0";
            Label19_Day7.Text = "0";
            Label20_Day7.Text = "0";

            SPListItem itemBudgetPL = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_PL");
            SPListItem itemBudgetHR = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_HR");
            SPListItem itemBudgetFC = Common.BusinessService.GetBudgetItem(coCd, year, "Budget_GRFC");

            

            if (itemBudgetHR != null)
            {
                string billData = itemBudgetHR["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "HR03010103")
                    {
                        switch (month)
                        {
                            case "1":
                                Label09_Day2.Text = p.Jan.ToString();
                                Label09_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label09_Day2.Text = p.Feb.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label09_Day2.Text = p.Mar.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label09_Day2.Text = p.Apr.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label09_Day2.Text = p.May.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label09_Day2.Text = p.Jun.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label09_Day2.Text = p.Jul.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label09_Day2.Text = p.Aug.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label09_Day2.Text = p.Sep.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label09_Day2.Text = p.Oct.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label09_Day2.Text = p.Nov.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label09_Day2.Text = p.Dec.ToString();
                                Label09_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }

                    if (p.accountcode == "HR03010102")
                    {
                        switch (month)
                        {
                            case "1":
                                Label19_Day2.Text = p.Jan.ToString();
                                Label19_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label19_Day2.Text = p.Feb.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label19_Day2.Text = p.Mar.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label19_Day2.Text = p.Apr.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label19_Day2.Text = p.May.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label19_Day2.Text = p.Jun.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label19_Day2.Text = p.Jul.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label19_Day2.Text = p.Aug.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label19_Day2.Text = p.Sep.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label19_Day2.Text = p.Oct.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label19_Day2.Text = p.Nov.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label19_Day2.Text = p.Dec.ToString();
                                Label19_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                });
            }
            Label09_Day7.Text = (Convert.ToDecimal(Label09_Day7.Text) / m).ToString("n");
            Label19_Day7.Text = (Convert.ToDecimal(Label19_Day7.Text) / m).ToString("n");

            if (itemBudgetFC != null)
            {
                string billData = itemBudgetFC["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "FC03010103")
                    {
                        switch (month)
                        {
                            case "1":
                                Label01_Day2.Text = p.Jan.ToString();
                                Label01_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label01_Day2.Text = p.Feb.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label01_Day2.Text = p.Mar.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label01_Day2.Text = p.Apr.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label01_Day2.Text = p.May.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label01_Day2.Text = p.Jun.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label01_Day2.Text = p.Jul.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label01_Day2.Text = p.Aug.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label01_Day2.Text = p.Sep.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label01_Day2.Text = p.Oct.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label01_Day2.Text = p.Nov.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label01_Day2.Text = p.Dec.ToString();
                                Label01_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "FC03010203")
                    {
                        switch (month)
                        {
                            case "1":
                                Label02_Day2.Text = p.Jan.ToString();
                                Label02_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label02_Day2.Text = p.Feb.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label02_Day2.Text = p.Mar.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label02_Day2.Text = p.Apr.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label02_Day2.Text = p.May.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label02_Day2.Text = p.Jun.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label02_Day2.Text = p.Jul.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label02_Day2.Text = p.Aug.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label02_Day2.Text = p.Sep.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label02_Day2.Text = p.Oct.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label02_Day2.Text = p.Nov.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label02_Day2.Text = p.Dec.ToString();
                                Label02_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "FC03010303")
                    {
                        switch (month)
                        {
                            case "1":
                                Label03_Day2.Text = p.Jan.ToString();
                                Label03_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label03_Day2.Text = p.Feb.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label03_Day2.Text = p.Mar.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label03_Day2.Text = p.Apr.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label03_Day2.Text = p.May.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label03_Day2.Text = p.Jun.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label03_Day2.Text = p.Jul.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label03_Day2.Text = p.Aug.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label03_Day2.Text = p.Sep.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label03_Day2.Text = p.Oct.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label03_Day2.Text = p.Nov.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label03_Day2.Text = p.Dec.ToString();
                                Label03_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }

                    if (p.accountcode == "FC03010403")
                    {
                        switch (month)
                        {
                            case "1":
                                Label05_Day2.Text = p.Jan.ToString();
                                Label05_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label05_Day2.Text = p.Feb.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label05_Day2.Text = p.Mar.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label05_Day2.Text = p.Apr.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label05_Day2.Text = p.May.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label05_Day2.Text = p.Jun.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label05_Day2.Text = p.Jul.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label05_Day2.Text = p.Aug.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label05_Day2.Text = p.Sep.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label05_Day2.Text = p.Oct.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label05_Day2.Text = p.Nov.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label05_Day2.Text = p.Dec.ToString();
                                Label05_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "FC03010503")
                    {
                        switch (month)
                        {
                            case "1":
                                Label06_Day2.Text = p.Jan.ToString();
                                Label06_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label06_Day2.Text = p.Feb.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label06_Day2.Text = p.Mar.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label06_Day2.Text = p.Apr.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label06_Day2.Text = p.May.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label06_Day2.Text = p.Jun.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label06_Day2.Text = p.Jul.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label06_Day2.Text = p.Aug.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label06_Day2.Text = p.Sep.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label06_Day2.Text = p.Oct.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label06_Day2.Text = p.Nov.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label06_Day2.Text = p.Dec.ToString();
                                Label06_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }

                    if (p.accountcode == "FC03010102")
                    {
                        switch (month)
                        {
                            case "1":
                                Label11_Day2.Text = p.Jan.ToString();
                                Label11_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label11_Day2.Text = p.Feb.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label11_Day2.Text = p.Mar.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label11_Day2.Text = p.Apr.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label11_Day2.Text = p.May.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label11_Day2.Text = p.Jun.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label11_Day2.Text = p.Jul.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label11_Day2.Text = p.Aug.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label11_Day2.Text = p.Sep.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label11_Day2.Text = p.Oct.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label11_Day2.Text = p.Nov.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label11_Day2.Text = p.Dec.ToString();
                                Label11_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "FC03010202")
                    {
                        switch (month)
                        {
                            case "1":
                                Label12_Day2.Text = p.Jan.ToString();
                                Label12_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label12_Day2.Text = p.Feb.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label12_Day2.Text = p.Mar.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label12_Day2.Text = p.Apr.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label12_Day2.Text = p.May.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label12_Day2.Text = p.Jun.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label12_Day2.Text = p.Jul.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label12_Day2.Text = p.Aug.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label12_Day2.Text = p.Sep.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label12_Day2.Text = p.Oct.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label12_Day2.Text = p.Nov.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label12_Day2.Text = p.Dec.ToString();
                                Label12_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "FC03010302")
                    {
                        switch (month)
                        {
                            case "1":
                                Label13_Day2.Text = p.Jan.ToString();
                                Label13_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label13_Day2.Text = p.Feb.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label13_Day2.Text = p.Mar.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label13_Day2.Text = p.Apr.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label13_Day2.Text = p.May.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label13_Day2.Text = p.Jun.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label13_Day2.Text = p.Jul.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label13_Day2.Text = p.Aug.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label13_Day2.Text = p.Sep.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label13_Day2.Text = p.Oct.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label13_Day2.Text = p.Nov.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label13_Day2.Text = p.Dec.ToString();
                                Label13_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }

                    if (p.accountcode == "FC03010402")
                    {
                        switch (month)
                        {
                            case "1":
                                Label15_Day2.Text = p.Jan.ToString();
                                Label15_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label15_Day2.Text = p.Feb.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label15_Day2.Text = p.Mar.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label15_Day2.Text = p.Apr.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label15_Day2.Text = p.May.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label15_Day2.Text = p.Jun.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label15_Day2.Text = p.Jul.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label15_Day2.Text = p.Aug.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label15_Day2.Text = p.Sep.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label15_Day2.Text = p.Oct.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label15_Day2.Text = p.Nov.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label15_Day2.Text = p.Dec.ToString();
                                Label15_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                    if (p.accountcode == "FC03010502")
                    {
                        switch (month)
                        {
                            case "1":
                                Label16_Day2.Text = p.Jan.ToString();
                                Label16_Day7.Text = p.Jan.ToString();
                                break;
                            case "2":
                                Label16_Day2.Text = p.Feb.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                Label16_Day2.Text = p.Mar.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                Label16_Day2.Text = p.Apr.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                Label16_Day2.Text = p.May.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                Label16_Day2.Text = p.Jun.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                Label16_Day2.Text = p.Jul.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                Label16_Day2.Text = p.Aug.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                Label16_Day2.Text = p.Sep.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                Label16_Day2.Text = p.Oct.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                Label16_Day2.Text = p.Nov.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                Label16_Day2.Text = p.Dec.ToString();
                                Label16_Day7.Text = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                });

                Label07_Day2.Text = Convert.ToString(Convert.ToDecimal(Label01_Day2.Text) + Convert.ToDecimal(Label02_Day2.Text) + Convert.ToDecimal(Label03_Day2.Text) + Convert.ToDecimal(Label05_Day2.Text) + Convert.ToDecimal(Label06_Day2.Text));
                Label17_Day2.Text = Convert.ToString(Convert.ToDecimal(Label11_Day2.Text) + Convert.ToDecimal(Label12_Day2.Text) + Convert.ToDecimal(Label13_Day2.Text) + Convert.ToDecimal(Label15_Day2.Text) + Convert.ToDecimal(Label16_Day2.Text));
                Label07_Day7.Text = Convert.ToString(Convert.ToDecimal(Label01_Day7.Text) + Convert.ToDecimal(Label02_Day7.Text) + Convert.ToDecimal(Label03_Day7.Text) + Convert.ToDecimal(Label05_Day7.Text) + Convert.ToDecimal(Label06_Day7.Text));
                Label17_Day7.Text = Convert.ToString(Convert.ToDecimal(Label11_Day7.Text) + Convert.ToDecimal(Label12_Day7.Text) + Convert.ToDecimal(Label13_Day7.Text) + Convert.ToDecimal(Label15_Day7.Text) + Convert.ToDecimal(Label16_Day7.Text));

            }


            if (itemBudgetPL != null)
            {
                string billData = itemBudgetPL["BillData"].ToString();

                JavaScriptSerializer Serializer = new JavaScriptSerializer();

                List<fsentity> obj = Serializer.Deserialize<List<fsentity>>(billData);

                var objentity = obj as List<fsentity>;

                string TonnagesHead = "0";
                string TonnagesHeadYTD = "0";

                objentity.ForEach(p =>
                {
                    if (p.accountcode == "PL03010101-1")
                    {
                        switch (month)
                        {
                            case "1":
                                TonnagesHead = p.Jan.ToString();
                                TonnagesHeadYTD = p.Jan.ToString();
                                break;
                            case "2":
                                TonnagesHead = p.Feb.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()));
                                break;
                            case "3":
                                TonnagesHead = p.Mar.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()));
                                break;
                            case "4":
                                TonnagesHead = p.Apr.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()));
                                break;
                            case "5":
                                TonnagesHead = p.May.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()));
                                break;
                            case "6":
                                TonnagesHead = p.Jun.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()));
                                break;
                            case "7":
                                TonnagesHead = p.Jul.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()));
                                break;
                            case "8":
                                TonnagesHead = p.Aug.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()));
                                break;
                            case "9":
                                TonnagesHead = p.Sep.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()));
                                break;
                            case "10":
                                TonnagesHead = p.Oct.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()));
                                break;
                            case "11":
                                TonnagesHead = p.Nov.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()));
                                break;
                            case "12":
                                TonnagesHead = p.Dec.ToString();
                                TonnagesHeadYTD = Convert.ToString(Convert.ToDecimal(p.Jan.ToString()) + Convert.ToDecimal(p.Feb.ToString()) + Convert.ToDecimal(p.Mar.ToString()) + Convert.ToDecimal(p.Apr.ToString()) + Convert.ToDecimal(p.May.ToString()) + Convert.ToDecimal(p.Jun.ToString()) + Convert.ToDecimal(p.Jul.ToString()) + Convert.ToDecimal(p.Aug.ToString()) + Convert.ToDecimal(p.Sep.ToString()) + Convert.ToDecimal(p.Oct.ToString()) + Convert.ToDecimal(p.Nov.ToString()) + Convert.ToDecimal(p.Dec.ToString()));
                                break;
                            default:
                                break;
                        }
                    }
                });

                if (TonnagesHead != "0" && TonnagesHead != "0.00")
                {
                    Label08_Day2.Text = (Convert.ToDecimal(Label07_Day2.Text) / Convert.ToDecimal(TonnagesHead)*1000).ToString("n");
                    Label18_Day2.Text = (Convert.ToDecimal(Label17_Day2.Text) / Convert.ToDecimal(TonnagesHead) * 1000).ToString("n");
                }

                if (Label09_Day2.Text == "0" || Label09_Day2.Text == "0.00")
                {
                    Label10_Day2.Text = "0";
                }
                else
                {
                    Label10_Day2.Text = (Convert.ToDecimal(TonnagesHead) / Convert.ToDecimal(Label09_Day2.Text)).ToString("n");
                }
                if (Label19_Day2.Text == "0" || Label19_Day2.Text == "0.00")
                {
                    Label20_Day2.Text = "0";
                }
                else
                {
                    Label20_Day2.Text = (Convert.ToDecimal(TonnagesHead) / Convert.ToDecimal(Label19_Day2.Text)).ToString("n");
                }

                if (TonnagesHeadYTD != "0" && TonnagesHeadYTD != "0.00")
                {
                    Label08_Day7.Text = (Convert.ToDecimal(Label07_Day7.Text) / Convert.ToDecimal(TonnagesHeadYTD)*1000).ToString("n");
                    Label18_Day7.Text = (Convert.ToDecimal(Label17_Day7.Text) / Convert.ToDecimal(TonnagesHeadYTD) * 1000).ToString("n");
                }

                if (Label09_Day7.Text == "0" || Label09_Day7.Text == "0.00")
                {
                    Label10_Day7.Text = "0";
                }
                else
                {
                    Label10_Day7.Text = (Convert.ToDecimal(TonnagesHeadYTD) / Convert.ToDecimal(Label09_Day7.Text)).ToString("n");
                }
                if (Label19_Day7.Text == "0" || Label19_Day7.Text == "0.00")
                {
                    Label20_Day7.Text = "0";
                }
                else
                {
                    Label20_Day7.Text = (Convert.ToDecimal(TonnagesHeadYTD) / Convert.ToDecimal(Label19_Day7.Text)).ToString("n");
                }
            }


            Label01_Day4.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - Convert.ToDecimal(Label01_Day2.Text));
            Label02_Day4.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - Convert.ToDecimal(Label02_Day2.Text));
            Label03_Day4.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - Convert.ToDecimal(Label03_Day2.Text));
            Label04_Day4.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - Convert.ToDecimal(Label04_Day2.Text));
            Label05_Day4.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - Convert.ToDecimal(Label05_Day2.Text));
            Label06_Day4.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(Label06_Day2.Text));
            Label07_Day4.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - Convert.ToDecimal(Label07_Day2.Text));
            Label08_Day4.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(Label08_Day2.Text));
            Label09_Day4.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - Convert.ToDecimal(Label09_Day2.Text));
            Label10_Day4.Text = Convert.ToString(Convert.ToDecimal(Label10_Day3.Text) - Convert.ToDecimal(Label10_Day2.Text));
            Label11_Day4.Text = Convert.ToString(Convert.ToDecimal(Label11_Day3.Text) - Convert.ToDecimal(Label11_Day2.Text));
            Label12_Day4.Text = Convert.ToString(Convert.ToDecimal(Label12_Day3.Text) - Convert.ToDecimal(Label12_Day2.Text));
            Label13_Day4.Text = Convert.ToString(Convert.ToDecimal(Label13_Day3.Text) - Convert.ToDecimal(Label13_Day2.Text));
            Label14_Day4.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - Convert.ToDecimal(Label14_Day2.Text));
            Label15_Day4.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - Convert.ToDecimal(Label15_Day2.Text));
            Label16_Day4.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - Convert.ToDecimal(Label16_Day2.Text));
            Label17_Day4.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - Convert.ToDecimal(Label17_Day2.Text));
            Label18_Day4.Text = Convert.ToString(Convert.ToDecimal(Label18_Day3.Text) - Convert.ToDecimal(Label18_Day2.Text));
            Label19_Day4.Text = Convert.ToString(Convert.ToDecimal(Label19_Day3.Text) - Convert.ToDecimal(Label19_Day2.Text));
            Label20_Day4.Text = Convert.ToString(Convert.ToDecimal(Label20_Day3.Text) - Convert.ToDecimal(Label20_Day2.Text));


            Label01_Day5.Text = Convert.ToString(Convert.ToDecimal(Label01_Day3.Text) - Convert.ToDecimal(Label01_Day1.Text));
            Label02_Day5.Text = Convert.ToString(Convert.ToDecimal(Label02_Day3.Text) - Convert.ToDecimal(Label02_Day1.Text));
            Label03_Day5.Text = Convert.ToString(Convert.ToDecimal(Label03_Day3.Text) - Convert.ToDecimal(Label03_Day1.Text));
            Label04_Day5.Text = Convert.ToString(Convert.ToDecimal(Label04_Day3.Text) - Convert.ToDecimal(Label04_Day1.Text));
            Label05_Day5.Text = Convert.ToString(Convert.ToDecimal(Label05_Day3.Text) - Convert.ToDecimal(Label05_Day1.Text));
            Label06_Day5.Text = Convert.ToString(Convert.ToDecimal(Label06_Day3.Text) - Convert.ToDecimal(Label06_Day1.Text));
            Label07_Day5.Text = Convert.ToString(Convert.ToDecimal(Label07_Day3.Text) - Convert.ToDecimal(Label07_Day1.Text));
            Label08_Day5.Text = Convert.ToString(Convert.ToDecimal(Label08_Day3.Text) - Convert.ToDecimal(Label08_Day1.Text));
            Label09_Day5.Text = Convert.ToString(Convert.ToDecimal(Label09_Day3.Text) - Convert.ToDecimal(Label09_Day1.Text));
            Label10_Day5.Text = Convert.ToString(Convert.ToDecimal(Label10_Day3.Text) - Convert.ToDecimal(Label10_Day1.Text));
            Label11_Day5.Text = Convert.ToString(Convert.ToDecimal(Label11_Day3.Text) - Convert.ToDecimal(Label11_Day1.Text));
            Label12_Day5.Text = Convert.ToString(Convert.ToDecimal(Label12_Day3.Text) - Convert.ToDecimal(Label12_Day1.Text));
            Label13_Day5.Text = Convert.ToString(Convert.ToDecimal(Label13_Day3.Text) - Convert.ToDecimal(Label13_Day1.Text));
            Label14_Day5.Text = Convert.ToString(Convert.ToDecimal(Label14_Day3.Text) - Convert.ToDecimal(Label14_Day1.Text));
            Label15_Day5.Text = Convert.ToString(Convert.ToDecimal(Label15_Day3.Text) - Convert.ToDecimal(Label15_Day1.Text));
            Label16_Day5.Text = Convert.ToString(Convert.ToDecimal(Label16_Day3.Text) - Convert.ToDecimal(Label16_Day1.Text));
            Label17_Day5.Text = Convert.ToString(Convert.ToDecimal(Label17_Day3.Text) - Convert.ToDecimal(Label17_Day1.Text));
            Label18_Day5.Text = Convert.ToString(Convert.ToDecimal(Label18_Day3.Text) - Convert.ToDecimal(Label18_Day1.Text));
            Label19_Day5.Text = Convert.ToString(Convert.ToDecimal(Label19_Day3.Text) - Convert.ToDecimal(Label19_Day1.Text));
            Label20_Day5.Text = Convert.ToString(Convert.ToDecimal(Label20_Day3.Text) - Convert.ToDecimal(Label20_Day1.Text));


            Label01_Day9.Text = Convert.ToString(Convert.ToDecimal(Label01_Day8.Text) - Convert.ToDecimal(Label01_Day7.Text));
            Label02_Day9.Text = Convert.ToString(Convert.ToDecimal(Label02_Day8.Text) - Convert.ToDecimal(Label02_Day7.Text));
            Label03_Day9.Text = Convert.ToString(Convert.ToDecimal(Label03_Day8.Text) - Convert.ToDecimal(Label03_Day7.Text));
            Label04_Day9.Text = Convert.ToString(Convert.ToDecimal(Label04_Day8.Text) - Convert.ToDecimal(Label04_Day7.Text));
            Label05_Day9.Text = Convert.ToString(Convert.ToDecimal(Label05_Day8.Text) - Convert.ToDecimal(Label05_Day7.Text));
            Label06_Day9.Text = Convert.ToString(Convert.ToDecimal(Label06_Day8.Text) - Convert.ToDecimal(Label06_Day7.Text));
            Label07_Day9.Text = Convert.ToString(Convert.ToDecimal(Label07_Day8.Text) - Convert.ToDecimal(Label07_Day7.Text));
            Label08_Day9.Text = Convert.ToString(Convert.ToDecimal(Label08_Day8.Text) - Convert.ToDecimal(Label08_Day7.Text));
            Label09_Day9.Text = Convert.ToString(Convert.ToDecimal(Label09_Day8.Text) - Convert.ToDecimal(Label09_Day7.Text));
            Label10_Day9.Text = Convert.ToString(Convert.ToDecimal(Label10_Day8.Text) - Convert.ToDecimal(Label10_Day7.Text));
            Label11_Day9.Text = Convert.ToString(Convert.ToDecimal(Label11_Day8.Text) - Convert.ToDecimal(Label11_Day7.Text));
            Label12_Day9.Text = Convert.ToString(Convert.ToDecimal(Label12_Day8.Text) - Convert.ToDecimal(Label12_Day7.Text));
            Label13_Day9.Text = Convert.ToString(Convert.ToDecimal(Label13_Day8.Text) - Convert.ToDecimal(Label13_Day7.Text));
            Label14_Day9.Text = Convert.ToString(Convert.ToDecimal(Label14_Day8.Text) - Convert.ToDecimal(Label14_Day7.Text));
            Label15_Day9.Text = Convert.ToString(Convert.ToDecimal(Label15_Day8.Text) - Convert.ToDecimal(Label15_Day7.Text));
            Label16_Day9.Text = Convert.ToString(Convert.ToDecimal(Label16_Day8.Text) - Convert.ToDecimal(Label16_Day7.Text));
            Label17_Day9.Text = Convert.ToString(Convert.ToDecimal(Label17_Day8.Text) - Convert.ToDecimal(Label17_Day7.Text));
            Label18_Day9.Text = Convert.ToString(Convert.ToDecimal(Label18_Day8.Text) - Convert.ToDecimal(Label18_Day7.Text));
            Label19_Day9.Text = Convert.ToString(Convert.ToDecimal(Label19_Day8.Text) - Convert.ToDecimal(Label19_Day7.Text));
            Label20_Day9.Text = Convert.ToString(Convert.ToDecimal(Label20_Day8.Text) - Convert.ToDecimal(Label20_Day7.Text));


            Label01_Day10.Text = Convert.ToString(Convert.ToDecimal(Label01_Day8.Text) - Convert.ToDecimal(Label01_Day6.Text));
            Label02_Day10.Text = Convert.ToString(Convert.ToDecimal(Label02_Day8.Text) - Convert.ToDecimal(Label02_Day6.Text));
            Label03_Day10.Text = Convert.ToString(Convert.ToDecimal(Label03_Day8.Text) - Convert.ToDecimal(Label03_Day6.Text));
            Label04_Day10.Text = Convert.ToString(Convert.ToDecimal(Label04_Day8.Text) - Convert.ToDecimal(Label04_Day6.Text));
            Label05_Day10.Text = Convert.ToString(Convert.ToDecimal(Label05_Day8.Text) - Convert.ToDecimal(Label05_Day6.Text));
            Label06_Day10.Text = Convert.ToString(Convert.ToDecimal(Label06_Day8.Text) - Convert.ToDecimal(Label06_Day6.Text));
            Label07_Day10.Text = Convert.ToString(Convert.ToDecimal(Label07_Day8.Text) - Convert.ToDecimal(Label07_Day6.Text));
            Label08_Day10.Text = Convert.ToString(Convert.ToDecimal(Label08_Day8.Text) - Convert.ToDecimal(Label08_Day6.Text));
            Label09_Day10.Text = Convert.ToString(Convert.ToDecimal(Label09_Day8.Text) - Convert.ToDecimal(Label09_Day6.Text));
            Label10_Day10.Text = Convert.ToString(Convert.ToDecimal(Label10_Day8.Text) - Convert.ToDecimal(Label10_Day6.Text));
            Label11_Day10.Text = Convert.ToString(Convert.ToDecimal(Label11_Day8.Text) - Convert.ToDecimal(Label11_Day6.Text));
            Label12_Day10.Text = Convert.ToString(Convert.ToDecimal(Label12_Day8.Text) - Convert.ToDecimal(Label12_Day6.Text));
            Label13_Day10.Text = Convert.ToString(Convert.ToDecimal(Label13_Day8.Text) - Convert.ToDecimal(Label13_Day6.Text));
            Label14_Day10.Text = Convert.ToString(Convert.ToDecimal(Label14_Day8.Text) - Convert.ToDecimal(Label14_Day6.Text));
            Label15_Day10.Text = Convert.ToString(Convert.ToDecimal(Label15_Day8.Text) - Convert.ToDecimal(Label15_Day6.Text));
            Label16_Day10.Text = Convert.ToString(Convert.ToDecimal(Label16_Day8.Text) - Convert.ToDecimal(Label16_Day6.Text));
            Label17_Day10.Text = Convert.ToString(Convert.ToDecimal(Label17_Day8.Text) - Convert.ToDecimal(Label17_Day6.Text));
            Label18_Day10.Text = Convert.ToString(Convert.ToDecimal(Label18_Day8.Text) - Convert.ToDecimal(Label18_Day6.Text));
            Label19_Day10.Text = Convert.ToString(Convert.ToDecimal(Label19_Day8.Text) - Convert.ToDecimal(Label19_Day6.Text));
            Label20_Day10.Text = Convert.ToString(Convert.ToDecimal(Label20_Day8.Text) - Convert.ToDecimal(Label20_Day6.Text));

        }

    }
}
